package view;

import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 *
 * @author Marcos Garcia Ortega
 */
public class JGSFileFilter extends FileFilter {

    private String extension, description;

    public JGSFileFilter(String extension, String description) {
        this.extension = extension;
        this.description = description;
    }

    public String getExtension() {
        return extension;
    }

    public String getDescription() {
        return description;
    }

    public boolean accept(File pathname) {
        if (pathname.getAbsolutePath().endsWith("." + extension)) {
            return true;
        }
        return false;
    }
}
